export let layout  = {
  title: process.env.VUE_APP_DISPLAY_NAME,
  desc: process.env.VUE_APP_DESCRIPTION,
  keys: {
    eventMenu: 'x-event-layout-menu',
    eventNavBtns: 'x-event-layout-nav-btns',
    eventMenuEmbed: 'x-event-layout-menu-embed',
    eventNavEmbed: 'x-event-layout-nav-embed',
    eventNavModules: 'x-event-layout-nav-modules',
    eventNavModuleChange: 'x-event-layout-nav-module-change',
  },
  setMenus(menus) {
    uni.$emit(uni.$x.layout.keys.eventMenu, menus)
  },
  setNavBtns(btns) {
    uni.$emit(uni.$x.layout.keys.eventNavBtns, btns)
  },
  setMenuEmbed(embed) {
    uni.$emit(uni.$x.layout.keys.eventMenuEmbed, embed)
  },
  setNavEmbed(embed) {
    uni.$emit(uni.$x.layout.keys.eventNavEmbed, embed)
  },
  setNavModules(modules) {
    uni.$emit(uni.$x.layout.keys.eventNavModules, modules)
  },
  splashShow() {
    // #ifdef XT_PC || X_WAP
    window.$xSplashStart&&window.$xSplashStart()
    // #endif
  },
  splashHide() {
    // #ifdef XT_PC || X_WAP
    window.$xSplashStop&&window.$xSplashStop()
    // #endif
  }
}

export default function($x, {
  layoutExtend,
}={}, app) {
  Object.assign(layout, layoutExtend)
  $x.layout = layout
}